// utils/loading.js
import { Loading } from 'element-ui';

let loadingInstance;

export default {
  show(options) {
    loadingInstance = Loading.service({
      lock: true,
      text: '加载中...',
      spinner: 'el-icon-loading',
      background: 'rgba(0, 0, 0, 0.7)',
      ...options
    });
  },
  hide() {
    if (loadingInstance) {
      loadingInstance.close();
    }
  }
};
